class Fset < ActiveRecord::Base
  belongs_to :user
  has_many :flashcards, :dependent => :destroy
  ajaxful_rateable :stars => 5
  acts_as_taggable

  validates_length_of :name, :within => 1..15
  
#
# Returns the most recent 5 game entries
#
  def get_stats (user)
    games = Game.find(:all, 
						:limit  => 5,  
						:order => 'created_at DESC',
						:conditions => ["user_id = ? and fset_id = ?", user, id])
	games.reverse
  end
  def self.per_page
    5
  end

  
end
